package ooday02;

import java.awt.*;
import java.util.Arrays;

public class Demo01分割字符串 {
    public static void main(String[] args) {
        String path = "http://localhost:8088/myweb/reg?name=zhangsan&pwd=123456&nick=san&age=16";
        String[] arr = path.split("\\?");
        System.out.println(Arrays.toString(arr));
        System.out.println(arr[1]);
        String[] brr = arr[1].split("&");
        System.out.println(Arrays.toString(brr));
        for (int i = 0; i < brr.length; i++) {
            String[] crr = brr[i].split("=");
            System.out.println("参数名:" + crr[0] +"\t"+ "参数值:" + crr[1]);
        }
    }
}
